global root_path "/Volumes/Workgroup/Lab/Lab-heimb/Montenovo/Volunteering Paper/Data"

clear all
set maxvar 32767

cd "$root_path/02_ready_for_PSIDclean"

use individ_family_2019.dta, clear

cd "$root/03_ready_for_TAXSIM"

**HH ID
rename ER72002 family_id

gen unique_id_crossys=(ER30001*1000) + ER30002


rename ER30000 release_number
rename ER30001 interview_number_1986
rename ER30002 person_number

gen sequence_num=ER34702


** Raceann

* wife
gen white_w=0
replace white_w=1 if ER76752==1 & ER76753==0 & ER76754==0 & ER76755==0

gen black_w=0
replace black_w=1 if ER76752==2 & ER76753==0 & ER76754==0 & ER76755==0

gen native_amer_w=0
replace native_amer_w=1 if ER76752==3 & ER76753==0 & ER76754==0 & ER76755==0

gen asian_w=0
replace asian_w=1 if ER76752==4 & ER76753==0 & ER76754==0 & ER76755==0

*gen latino_w=0
*replace latino_w=1 if ER70744==5 & ER70745==0 & ER70746==0 & ER70747==0

gen other_w=0
replace other_w=1 if (ER76752>=5) 
replace other_w=1 if ER76753!=0 | ER76754!=0 | ER76755!=0

gen any_race_w=white_w+black_w+native_amer_w+asian_w+other_w
sum any_race_w

*  3,721 have no recorded race in OUR data
*  3,524: no wife present
*  3,721-3,524 are mixed race so we did not code them yet

* husband
gen white_h=0
replace white_h=1 if ER76897==1 & ER76898==0 & ER76899==0 & ER76900==0

gen black_h=0
replace black_h=1 if ER76897==2 & ER76898==0 & ER76899==0 & ER76900==0

gen native_amer_h=0
replace native_amer_h=1 if ER76897==3 & ER76898==0 & ER76899==0 & ER76900==0

gen asian_h=0
replace asian_h=1 if ER76897==4 & ER76898==0 & ER76899==0 & ER76900==0

gen latino_h=0
replace latino_h=1 if ER76897==5 & ER76898==0 & ER76899==0 & ER76900==0

gen other_h=0
replace other_h=1 if (ER76897>=5) 
replace other_h=1 if ER76898!=0 | ER76899!=0 | ER76900!=0

gen any_race_h=white_h+black_h+native_amer_h+asian_h+other_h
sum any_race_h

*  7,524 have no recorded race in OUR data
*  298: are mixed race so we did not code them yet

** Identifiers.
** State of residence.
rename ER72003 state_residence
rename ER72004 state_current
rename ER72018  sex_head
rename ER72020 sex_spouse

** RAW FIELDS.
** Marriage stuff.
rename ER72024 marital_status_head
rename ER77601 marital_status_generated

gen married=0
replace married=1 if marital_status_head==1

keep if (sequence_num==1 & married==0) | (sequence_num==1 & married==1) | (sequence_num==2 & married==1)


** Children.
rename ER72021 children
** Ages.
rename ER72017 age_head
rename ER72019 age_wife
rename ER72022 age_youngest_child
** Salary.
rename ER72164 emplstat_head
rename ER72168 work_for_money_head
rename ER72210 how_paid_head
rename ER72211 salary_hd
rename ER72212 salary_frequency_head
rename ER72441 emplstat_wife
rename ER72445 work_for_money_wife
rename ER72488 salary_wife
rename ER72489 salary_frequency_wife
** Batch income fields.
rename ER72995 g4_pyr_net_farm_income
rename ER73010 g11b_profit_loss_bus_1
rename ER73011 g11b_profit_loss_bus_2
rename ER73012 g11b_profit_loss_bus_3
rename ER73013 g11b_profit_loss_bus_4
rename ER73014 g11b_profit_loss_bus_5
rename ER73071 g14_16_hd_bonus_ot_comm
rename ER73085 amt_other_labor_y_head
rename ER73088 g18a_wtr_head_prof_pract
rename ER73092 prof_trade_income_h_jan
rename ER73093 prof_trade_income_h_feb
rename ER73094 prof_trade_income_h_mar
rename ER73095 prof_trade_income_h_apr
rename ER73096 prof_trade_income_h_may
rename ER73097 prof_trade_income_h_jun
rename ER73098 prof_trade_income_h_jul
rename ER73099 prof_trade_income_h_aug
rename ER73100 prof_trade_income_h_sep
rename ER73101 prof_trade_income_h_oct
rename ER73102 prof_trade_income_h_nov
rename ER73103 prof_trade_income_h_dec
/*
rename ER36964 g18b_wtr_head_mkt_gdning
rename ER36968 garden_farm_income_h_jan
rename ER36969 garden_farm_income_h_feb
rename ER36970 garden_farm_income_h_mar
rename ER36971 garden_farm_income_h_apr
rename ER36972 garden_farm_income_h_may
rename ER36973 garden_farm_income_h_jun
rename ER36974 garden_farm_income_h_jul
rename ER36975 garden_farm_income_h_aug
rename ER36976 garden_farm_income_h_sep
rename ER36977 garden_farm_income_h_oct
rename ER36978 garden_farm_income_h_nov
rename ER36979 garden_farm_income_h_dec
rename ER36981 g18c_wtr_head_roomers
rename ER36985 room_bord_income_h_jan
rename ER36986 room_bord_income_h_feb
rename ER36987 room_bord_income_h_mar
rename ER36988 room_bord_income_h_apr
rename ER36989 room_bord_income_h_may
rename ER36990 room_bord_income_h_jun
rename ER36991 room_bord_income_h_jul
rename ER36992 room_bord_income_h_aug
rename ER36993 room_bord_income_h_sep
rename ER36994 room_bord_income_h_oct
rename ER36995 room_bord_income_h_nov
rename ER36996 room_bord_income_h_dec
*/
rename ER73108 g25a_whether_rent_head
rename ER73113 rent_income_head_jan
rename ER73114 rent_income_head_feb
rename ER73115 rent_income_head_mar
rename ER73116 rent_income_head_apr
rename ER73117 rent_income_head_may
rename ER73118 rent_income_head_jun
rename ER73119 rent_income_head_jul
rename ER73120 rent_income_head_aug
rename ER73121 rent_income_head_sep
rename ER73122 rent_income_head_oct
rename ER73123 rent_income_head_nov
rename ER73124 rent_income_head_dec
rename ER73125 g25b_whether_dividends_head
rename ER73126 dividends_head_amt
rename ER73127 dividends_head_freq
rename ER73129 dividends_head_include_wife
rename ER73130 dividend_income_head_jan
rename ER73131 dividend_income_head_feb
rename ER73132 dividend_income_head_mar
rename ER73133 dividend_income_head_apr
rename ER73134 dividend_income_head_may
rename ER73135 dividend_income_head_jun
rename ER73136 dividend_income_head_jul
rename ER73137 dividend_income_head_aug
rename ER73138 dividend_income_head_sep
rename ER73139 dividend_income_head_oct
rename ER73140 dividend_income_head_nov
rename ER73141 dividend_income_head_dec
rename ER73142 g25c_whether_interest_head
rename ER73147 interest_income_head_jan
rename ER73148 interest_income_head_feb
rename ER73149 interest_income_head_mar
rename ER73150 interest_income_head_apr
rename ER73151 interest_income_head_may
rename ER73152 interest_income_head_jun
rename ER73153 interest_income_head_jul
rename ER73154 interest_income_head_aug
rename ER73155 interest_income_head_sep
rename ER73156 interest_income_head_oct
rename ER73157 interest_income_head_nov
rename ER73158 interest_income_head_dec
rename ER73159 whether_trust_fund_head
rename ER73163 trust_royal_income_h_jan
rename ER73164 trust_royal_income_h_feb
rename ER73165 trust_royal_income_h_mar
rename ER73166 trust_royal_income_h_apr
rename ER73167 trust_royal_income_h_may
rename ER73168 trust_royal_income_h_jun
rename ER73169 trust_royal_income_h_jul
rename ER73170 trust_royal_income_h_aug
rename ER73171 trust_royal_income_h_sep
rename ER73172 trust_royal_income_h_oct
rename ER73173 trust_royal_income_h_nov
rename ER73174 trust_royal_income_h_dec
rename ER73176 g25e_whether_adc_tanf_head
rename ER73180 adc_tanf_income_head_jan
rename ER73181 adc_tanf_income_head_feb
rename ER73182 adc_tanf_income_head_mar
rename ER73183 adc_tanf_income_head_apr
rename ER73184 adc_tanf_income_head_may
rename ER73185 adc_tanf_income_head_jun
rename ER73186 adc_tanf_income_head_jul
rename ER73187 adc_tanf_income_head_aug
rename ER73188 adc_tanf_income_head_sep
rename ER73189 adc_tanf_income_head_oct
rename ER73190 adc_tanf_income_head_nov
rename ER73191 adc_tanf_income_head_dec
rename ER73192 g25f_whether_ssi_head
rename ER73194 ssi_of_head
rename ER73195 ssi_of_head_per
rename ER73197 ssi_income_head_jan
rename ER73198 ssi_income_head_feb
rename ER73199 ssi_income_head_mar
rename ER73200 ssi_income_head_apr
rename ER73201 ssi_income_head_may
rename ER73202 ssi_income_head_jun
rename ER73203 ssi_income_head_jul
rename ER73204 ssi_income_head_aug
rename ER73205 ssi_income_head_sep
rename ER73206 ssi_income_head_oct
rename ER73207 ssi_income_head_nov
rename ER73208 ssi_income_head_dec
rename ER73209 g25g_whether_other_welfare_hd
rename ER73213 otr_welfare_income_h_jan
rename ER73214 otr_welfare_income_h_feb
rename ER73215 otr_welfare_income_h_mar
rename ER73216 otr_welfare_income_h_apr
rename ER73217 otr_welfare_income_h_may
rename ER73218 otr_welfare_income_h_jun
rename ER73219 otr_welfare_income_h_jul
rename ER73220 otr_welfare_income_h_aug
rename ER73221 otr_welfare_income_h_sep
rename ER73222 otr_welfare_income_h_oct
rename ER73223 otr_welfare_income_h_nov
rename ER73224 otr_welfare_income_h_dec
rename ER73225 g31_any_fu_memb_get_socsec
//rename ER37118 g37_whether_head_va_pension ASK BRAD


rename ER73233 va_income_head_jan
rename ER73234 va_income_head_feb
rename ER73235 va_income_head_mar
rename ER73236 va_income_head_apr
rename ER73237 va_income_head_may
rename ER73238 va_income_head_jun
rename ER73239 va_income_head_jul
rename ER73240 va_income_head_aug
rename ER73241 va_income_head_sep
rename ER73242 va_income_head_oct
rename ER73243 va_income_head_nov
rename ER73244 va_income_head_dec
rename ER73245 g40a_wtr_nonva_retiremt_head
rename ER73246 nonva_retiremt_head_amt
rename ER73247 nonva_retiremt_head_unit
rename ER73249 retirement_income_h_jan
rename ER73250 retirement_income_h_feb
rename ER73251 retirement_income_h_mar
rename ER73252 retirement_income_h_apr
rename ER73253 retirement_income_h_may
rename ER73254 retirement_income_h_jun
rename ER73255 retirement_income_h_jul
rename ER73256 retirement_income_h_aug
rename ER73257 retirement_income_h_sep
rename ER73258 retirement_income_h_oct
rename ER73259 retirement_income_h_nov
rename ER73260 retirement_income_h_dec

rename ER73261 g40b_whether_head_annuities
/*rename ER67242 annuities_income_jan
rename ER67242 annuities_income_feb
rename ER67242 annuities_income_mar
rename ER67242 annuities_income_apr
rename ER67242 annuities_income_may
rename ER67242 annuities_income_jun
rename ER67242 annuities_income_jul
rename ER67242 annuities_income_aug
rename ER67242 annuities_income_sep
rename ER67242 annuities_income_oct
rename ER67242 annuities_income_nov
rename ER67242 annuities_income_dec
*/
rename ER73277 g40c_whether_head_otr_pension
rename ER73281 otr_pension_head_jan
rename ER73282 otr_pension_head_feb
rename ER73283 otr_pension_head_mar
rename ER73284 otr_pension_head_apr
rename ER73285 otr_pension_head_may
rename ER73286 otr_pension_head_jun
rename ER73287 otr_pension_head_jul
rename ER73288 otr_pension_head_aug
rename ER73289 otr_pension_head_sep
rename ER73290 otr_pension_head_oct
rename ER73291 otr_pension_head_nov
rename ER73292 otr_pension_head_dec
rename ER73309 g43_num_of_head_non_va_pensn
rename ER73314 unemploy_income_head_jan
rename ER73315 unemploy_income_head_feb
rename ER73316 unemploy_income_head_mar
rename ER73317 unemploy_income_head_apr
rename ER73318 unemploy_income_head_may
rename ER73319 unemploy_income_head_jun
rename ER73320 unemploy_income_head_jul
rename ER73321 unemploy_income_head_aug
rename ER73322 unemploy_income_head_sep
rename ER73323 unemploy_income_head_oct
rename ER73324 unemploy_income_head_nov
rename ER73325 unemploy_income_head_dec
rename ER73326 g44b_wtr_workmen_comp_of_head
rename ER73330 worker_comp_income_h_jan
rename ER73331 worker_comp_income_h_feb
rename ER73332 worker_comp_income_h_mar
rename ER73333 worker_comp_income_h_apr
rename ER73334 worker_comp_income_h_may
rename ER73335 worker_comp_income_h_jun
rename ER73336 worker_comp_income_h_jul
rename ER73337 worker_comp_income_h_aug
rename ER73338 worker_comp_income_h_sep
rename ER73339 worker_comp_income_h_oct
rename ER73340 worker_comp_income_h_nov
rename ER73341 worker_comp_income_h_dec
rename ER73342 g44c_wtr_child_support_of_hd
rename ER73346 child_support_inc_h_jan
rename ER73347 child_support_inc_h_feb
rename ER73348 child_support_inc_h_mar
rename ER73349 child_support_inc_h_apr
rename ER73350 child_support_inc_h_may
rename ER73351 child_support_inc_h_jun
rename ER73352 child_support_inc_h_jul
rename ER73353 child_support_inc_h_aug
rename ER73354 child_support_inc_h_sep
rename ER73355 child_support_inc_h_oct
rename ER73356 child_support_inc_h_nov
rename ER73357 child_support_inc_h_dec
rename ER73358 g44d_wtr_alimony_of_head
rename ER73362 alimony_income_head_jan
rename ER73363 alimony_income_head_feb
rename ER73364 alimony_income_head_mar
rename ER73365 alimony_income_head_apr
rename ER73366 alimony_income_head_may
rename ER73367 alimony_income_head_jun
rename ER73368 alimony_income_head_jul
rename ER73369 alimony_income_head_aug
rename ER73370 alimony_income_head_sep
rename ER73371 alimony_income_head_oct
rename ER73372 alimony_income_head_nov
rename ER73373 alimony_income_head_dec
rename ER73378 help_from_relative_h_jan
rename ER73379 help_from_relative_h_feb
rename ER73380 help_from_relative_h_mar
rename ER73381 help_from_relative_h_apr
rename ER73382 help_from_relative_h_may
rename ER73383 help_from_relative_h_jun
rename ER73384 help_from_relative_h_jul
rename ER73385 help_from_relative_h_aug
rename ER73386 help_from_relative_h_sep
rename ER73387 help_from_relative_h_oct
rename ER73388 help_from_relative_h_nov
rename ER73389 help_from_relative_h_dec
rename ER73394 help_from_others_h_jan
rename ER73395 help_from_others_h_feb
rename ER73396 help_from_others_h_mar
rename ER73397 help_from_others_h_apr
rename ER73398 help_from_others_h_may
rename ER73399 help_from_others_h_jun
rename ER73400 help_from_others_h_jul
rename ER73401 help_from_others_h_aug
rename ER73402 help_from_others_h_sep
rename ER73403 help_from_others_h_oct
rename ER73404 help_from_others_h_nov
rename ER73405 help_from_others_h_dec
rename ER73406 g44g_wtr_anything_else_of_hd
rename ER73410 any_other_income_h_jan
rename ER73411 any_other_income_h_feb
rename ER73412 any_other_income_h_mar
rename ER73413 any_other_income_h_apr
rename ER73414 any_other_income_h_may
rename ER73415 any_other_income_h_jun
rename ER73416 any_other_income_h_jul
rename ER73417 any_other_income_h_aug
rename ER73418 any_other_income_h_sep
rename ER73419 any_other_income_h_oct
rename ER73420 any_other_income_h_nov
rename ER73421 any_other_income_h_dec
*rename ER37296 g50_whether_wife_had_income
rename ER73669 unemploy_income_wife_jan
rename ER73670 unemploy_income_wife_feb
rename ER73671 unemploy_income_wife_mar
rename ER73672 unemploy_income_wife_apr
rename ER73673 unemploy_income_wife_may
rename ER73674 unemploy_income_wife_jun
rename ER73675 unemploy_income_wife_jul
rename ER73676 unemploy_income_wife_aug
rename ER73677 unemploy_income_wife_sep
rename ER73678 unemploy_income_wife_oct
rename ER73679 unemploy_income_wife_nov
rename ER73680 unemploy_income_wife_dec
rename ER73684 worker_comp_income_w_jan
rename ER73685 worker_comp_income_w_feb
rename ER73686 worker_comp_income_w_mar
rename ER73687 worker_comp_income_w_apr
rename ER73688 worker_comp_income_w_may
rename ER73689 worker_comp_income_w_jun
rename ER73690 worker_comp_income_w_jul
rename ER73691 worker_comp_income_w_aug
rename ER73692 worker_comp_income_w_sep
rename ER73693 worker_comp_income_w_oct
rename ER73694 worker_comp_income_w_nov
rename ER73695 worker_comp_income_w_dec
rename ER73480 g59a_whether_wife_rent
rename ER73468 rent_income_wife_jan
rename ER73469 rent_income_wife_feb
rename ER73470 rent_income_wife_mar
rename ER73471 rent_income_wife_apr
rename ER73472 rent_income_wife_may
rename ER73473 rent_income_wife_jun
rename ER73474 rent_income_wife_jul
rename ER73475 rent_income_wife_aug
rename ER73476 rent_income_wife_sep
rename ER73477 rent_income_wife_oct
rename ER73478 rent_income_wife_nov
rename ER73479 rent_income_wife_dec
*rename ER67457 g59b_whether_wife_dividends
rename ER73481 dividends_wife_amt
rename ER73482 dividends_wife_freq
rename ER73484 dividends_wife_separate
rename ER73485 dividend_income_wife_jan
rename ER73486 dividend_income_wife_feb
rename ER73487 dividend_income_wife_mar
rename ER73488 dividend_income_wife_apr
rename ER73489 dividend_income_wife_may
rename ER73490 dividend_income_wife_jun
rename ER73491 dividend_income_wife_jul
rename ER73492 dividend_income_wife_aug
rename ER73493 dividend_income_wife_sep
rename ER73494 dividend_income_wife_oct
rename ER73495 dividend_income_wife_nov
rename ER73496 dividend_income_wife_dec
*rename ER67462 g59c_whether_wife_interest
rename ER73502 interest_income_wife_jan
rename ER73503 interest_income_wife_feb
rename ER73504 interest_income_wife_mar
rename ER73505 interest_income_wife_apr
rename ER73506 interest_income_wife_may
rename ER73507 interest_income_wife_jun
rename ER73508 interest_income_wife_jul
rename ER73509 interest_income_wife_aug
rename ER73510 interest_income_wife_sep
rename ER73511 interest_income_wife_oct
rename ER73512 interest_income_wife_nov
rename ER73513 interest_income_wife_dec
rename ER73514 g59d_whether_wife_trust_fund
rename ER73518 trust_income_wife_jan
rename ER73519 trust_income_wife_feb
rename ER73520 trust_income_wife_mar
rename ER73521 trust_income_wife_apr
rename ER73522 trust_income_wife_may
rename ER73523 trust_income_wife_jun
rename ER73524 trust_income_wife_jul
rename ER73525 trust_income_wife_aug
rename ER73526 trust_income_wife_sep
rename ER73527 trust_income_wife_oct
rename ER73528 trust_income_wife_nov
rename ER73529 trust_income_wife_dec
rename ER73547 g60a_whether_wife_recd_ssi
rename ER73549 ssi_of_wife_amt
rename ER73550 ssi_of_wife_amt_per
rename ER73552 ssi_income_wife_jan
rename ER73553 ssi_income_wife_feb
rename ER73554 ssi_income_wife_mar
rename ER73555 ssi_income_wife_apr
rename ER73556 ssi_income_wife_may
rename ER73557 ssi_income_wife_jun
rename ER73558 ssi_income_wife_jul
rename ER73559 ssi_income_wife_aug
rename ER73560 ssi_income_wife_sep
rename ER73561 ssi_income_wife_oct
rename ER73562 ssi_income_wife_nov
rename ER73563 ssi_income_wife_dec
rename ER73696 g60b_wtr_wife_recd_adc_tanf
/*rename ER37422 adc_tanf_income_wife_jan
rename ER37423 adc_tanf_income_wife_feb
rename ER37424 adc_tanf_income_wife_mar
rename ER37425 adc_tanf_income_wife_apr
rename ER37426 adc_tanf_income_wife_may
rename ER37427 adc_tanf_income_wife_jun
rename ER37428 adc_tanf_income_wife_jul
rename ER37429 adc_tanf_income_wife_aug
rename ER37430 adc_tanf_income_wife_sep
rename ER37431 adc_tanf_income_wife_oct
rename ER37432 adc_tanf_income_wife_nov
rename ER37433 adc_tanf_income_wife_dec

rename ER37434 g60c_wtr_wf_recd_child_supprt
*/
rename ER73700 child_support_inc_w_jan
rename ER73701 child_support_inc_w_feb
rename ER73702 child_support_inc_w_mar
rename ER73703 child_support_inc_w_apr
rename ER73704 child_support_inc_w_may
rename ER73705 child_support_inc_w_jun
rename ER73706 child_support_inc_w_jul
rename ER73707 child_support_inc_w_aug
rename ER73708 child_support_inc_w_sep
rename ER73709 child_support_inc_w_oct
rename ER73710 child_support_inc_w_nov
rename ER73711 child_support_inc_w_dec
rename ER73564 g60d_wtr_wf_recd_otr_welfare
rename ER73568 other_welfare_inc_w_jan
rename ER73569 other_welfare_inc_w_feb
rename ER73570 other_welfare_inc_w_mar
rename ER73571 other_welfare_inc_w_apr
rename ER73572 other_welfare_inc_w_may
rename ER73573 other_welfare_inc_w_jun
rename ER73574 other_welfare_inc_w_jul
rename ER73575 other_welfare_inc_w_aug
rename ER73576 other_welfare_inc_w_sep
rename ER73577 other_welfare_inc_w_oct
rename ER73578 other_welfare_inc_w_nov
rename ER73579 other_welfare_inc_w_dec
rename ER73615 g61_wtr_wf_recd_pens_annuity
rename ER73619 pension_annuity_w_jan
rename ER73620 pension_annuity_w_feb
rename ER73621 pension_annuity_w_mar
rename ER73622 pension_annuity_w_apr
rename ER73623 pension_annuity_w_may
rename ER73624 pension_annuity_w_jun
rename ER73625 pension_annuity_w_jul
rename ER73626 pension_annuity_w_aug
rename ER73627 pension_annuity_w_sep
rename ER73628 pension_annuity_w_oct
rename ER73629 pension_annuity_w_nov
rename ER73630 pension_annuity_w_dec
rename ER73732 help_fr_relatives_wf_jan
rename ER73733 help_fr_relatives_wf_feb
rename ER73734 help_fr_relatives_wf_mar
rename ER73735 help_fr_relatives_wf_apr
rename ER73736 help_fr_relatives_wf_may
rename ER73737 help_fr_relatives_wf_jun
rename ER73738 help_fr_relatives_wf_jul
rename ER73739 help_fr_relatives_wf_aug
rename ER73740 help_fr_relatives_wf_sep
rename ER73741 help_fr_relatives_wf_oct
rename ER73742 help_fr_relatives_wf_nov
rename ER73743 help_fr_relatives_wf_dec
rename ER73748 help_from_friends_w_jan
rename ER73749 help_from_friends_w_feb
rename ER73750 help_from_friends_w_mar
rename ER73751 help_from_friends_w_apr
rename ER73752 help_from_friends_w_may
rename ER73753 help_from_friends_w_jun
rename ER73754 help_from_friends_w_jul
rename ER73755 help_from_friends_w_aug
rename ER73756 help_from_friends_w_sep
rename ER73757 help_from_friends_w_oct
rename ER73758 help_from_friends_w_nov
rename ER73759 help_from_friends_w_dec
rename ER73760 g63_wtr_wfe_recd_otr_income
rename ER73764 any_other_income_w_jan
rename ER73765 any_other_income_w_feb
rename ER73766 any_other_income_w_mar
rename ER73767 any_other_income_w_apr
rename ER73768 any_other_income_w_may
rename ER73769 any_other_income_w_jun
rename ER73770 any_other_income_w_jul
rename ER73771 any_other_income_w_aug
rename ER73772 any_other_income_w_sep
rename ER73773 any_other_income_w_oct
rename ER73774 any_other_income_w_nov
rename ER73775 any_other_income_w_dec
rename ER73779 g102_wtr_itemize_for_tax
rename ER73789 g106_total_supp_of_otrs
rename ER73826 revised_dividends
rename ER73827 revised_dividends_unit
rename ER73828 w20f_wtr_rec_rev_dividends_jan
rename ER73829 w20f_wtr_rec_rev_dividends_feb
rename ER73830 w20f_wtr_rec_rev_dividends_mar
rename ER73831 w20f_wtr_rec_rev_dividends_apr
rename ER73832 w20f_wtr_rec_rev_dividends_may
rename ER73833 w20f_wtr_rec_rev_dividends_jun
rename ER73834 w20f_wtr_rec_rev_dividends_jul
rename ER73835 w20f_wtr_rec_rev_dividends_aug
rename ER73836 w20f_wtr_rec_rev_dividends_sep
rename ER73837 w20f_wtr_rec_rev_dividends_oct
rename ER73838 w20f_wtr_rec_rev_dividends_nov
rename ER73839 w20f_wtr_rec_rev_dividends_dec
rename ER73862 w31f_wtr_rec_rev_interest_in_jan
rename ER73863 w31f_wtr_rec_rev_interest_in_feb
rename ER73864 w31f_wtr_rec_rev_interest_in_mar
rename ER73865 w31f_wtr_rec_rev_interest_in_apr
rename ER73866 w31f_wtr_rec_rev_interest_in_may
rename ER73867 w31f_wtr_rec_rev_interest_in_jun
rename ER73868 w31f_wtr_rec_rev_interest_in_jul
rename ER73869 w31f_wtr_rec_rev_interest_in_aug
rename ER73870 w31f_wtr_rec_rev_interest_in_sep
rename ER73871 w31f_wtr_rec_rev_interest_in_oct
rename ER73872 w31f_wtr_rec_rev_interest_in_nov
rename ER73873 w31f_wtr_rec_rev_interest_in_dec
/*
rename ER40687 r16_wtr_rec_asset_y_yr_b4_last
rename ER40690 r19_wtr_rec_asset_y_jan_yr_b4lst
rename ER40691 r19_wtr_rec_asset_y_feb_yr_b4lst
rename ER40692 r19_wtr_rec_asset_y_mar_yr_b4lst
rename ER40693 r19_wtr_rec_asset_y_apr_yr_b4lst
rename ER40694 r19_wtr_rec_asset_y_may_yr_b4lst
rename ER40695 r19_wtr_rec_asset_y_jun_yr_b4lst
rename ER40696 r19_wtr_rec_asset_y_jul_yr_b4lst
rename ER40697 r19_wtr_rec_asset_y_aug_yr_b4lst
rename ER40698 r19_wtr_rec_asset_y_sep_yr_b4lst
rename ER40699 r19_wtr_rec_asset_y_oct_yr_b4lst
rename ER40700 r19_wtr_rec_asset_y_nov_yr_b4lst
rename ER40701 r19_wtr_rec_asset_y_dec_yr_b4lst

rename ER40702 r20_wtr_rec_soc_sec_yr_b4lst
rename ER40719 r25_wtr_recd_retirement_yr_b4lst
rename ER40722 r28_wtr_recd_reti_jan_yr_b4lst
rename ER40723 r28_wtr_recd_reti_feb_yr_b4lst
rename ER40724 r28_wtr_recd_reti_mar_yr_b4lst
rename ER40725 r28_wtr_recd_retir_apr_yr_b4lst
rename ER40726 r28_wtr_recd_retir_may_yr_b4lst
rename ER40727 r28_wtr_recd_retir_jun_yr_b4lst
rename ER40728 r28_wtr_recd_retir_jul_yr_b4lst
rename ER40729 r28_wtr_recd_retir_aug_yr_b4lst
rename ER40730 r28_wtr_recd_retir_sep_yr_b4lst
rename ER40731 r28_wtr_recd_retir_oct_yr_b4lst
rename ER40732 r28_wtr_recd_retir_nov_yr_b4lst
rename ER40733 r28_wtr_recd_retir_dec_yr_b4lst
rename ER40734 r29_wtr_rec_va_pension_yr_b4lst
rename ER40737 r32_wtr_rec_va_pens_jan_yr_b4lst
rename ER40738 r32_wtr_rec_va_pens_feb_yr_b4lst
rename ER40739 r32_wtr_rec_va_pens_mar_yr_b4lst
rename ER40740 r32_wtr_rec_va_pens_apr_yr_b4lst
rename ER40741 r32_wtr_rec_va_pens_may_yr_b4lst
rename ER40742 r32_wtr_rec_va_pens_jun_yr_b4lst
rename ER40743 r32_wtr_rec_va_pens_jul_yr_b4lst
rename ER40744 r32_wtr_rec_va_pens_aug_yr_b4lst
rename ER40745 r32_wtr_rec_va_pens_sep_yr_b4lst
rename ER40746 r32_wtr_rec_va_pens_oct_yr_b4lst
rename ER40747 r32_wtr_rec_va_pens_nov_yr_b4lst
rename ER40748 r32_wtr_rec_va_pens_dec_yr_b4lst
rename ER40749 r33_wtr_recd_unemp_comp_yr_b4lst
rename ER40764 r37_wtr_recd_wrks_cmp_yr_b4lst
rename ER40794 wtr_rec_ch_supp_almny_jan_yb4lst
rename ER40828 wtr_rec_ch_supp_almny_feb_yb4lst
rename ER40829 wtr_rec_ch_supp_almny_mar_yb4lst
rename ER40830 wtr_rec_ch_supp_almny_apr_yb4lst
rename ER40831 wtr_rec_ch_supp_almny_may_yb4lst
rename ER40832 wtr_rec_ch_supp_almny_jun_yb4lst
rename ER40833 wtr_rec_ch_supp_almny_jul_yb4lst
rename ER40834 wtr_rec_ch_supp_almny_aug_yb4lst
rename ER40835 wtr_rec_ch_supp_almny_sep_yb4lst
rename ER40836 wtr_rec_ch_supp_almny_oct_yb4lst
rename ER40837 wtr_rec_ch_supp_almny_nov_yb4lst
rename ER40838 wtr_rec_ch_supp_almny_dec_yb4lst
rename ER40854 r63_wtr_any_otr_income_2_yrs_ago
rename ER40855 r66_amt_of_income_2_yrs_ago
rename ER40856 r66_per_for_amt_of_inc_2_yrs_ago
rename ER40857 r67_wtr_recd_incom_jan_2_yrs_ago
rename ER40858 r67_wtr_recd_incom_feb_2_yrs_ago
rename ER40859 r67_wtr_recd_incom_mar_2_yrs_ago
rename ER40860 r67_wtr_recd_incom_apr_2_yrs_ago
rename ER40861 r67_wtr_recd_incom_may_2_yrs_ago
rename ER40862 r67_wtr_recd_incom_jun_2_yrs_ago
rename ER40863 r67_wtr_recd_incom_jul_2_yrs_ago
rename ER40864 r67_wtr_recd_incom_aug_2_yrs_ago
rename ER40865 r67_wtr_recd_incom_sep_2_yrs_ago
rename ER40866 r67_wtr_recd_incom_oct_2_yrs_ago
rename ER40867 r67_wtr_recd_incom_nov_2_yrs_ago
rename ER40868 r67_wtr_recd_incom_dec_2_yrs_ago

rename ER40916 acc_market_garden_income_of_head
rename ER40918 acc_of_head_addtional_job_income
*/
** Rent (for state taxes).
rename ER72030 own_rent_or_what
rename ER72090 rent_amount
rename ER72091 rent_amount_unit
rename ER72095 rent_include_heat
rename ER72071 rent_paid_by_govt
rename ER72098 home_equivalent_rent
rename ER72099 home_equivalent_rent_unit
** Taxes.
rename ER72045 property_tax_annual
** Deductions.
** Strange bug from PSID dofile.
rename g102_wtr_itemize_for_tax whether_itemized
rename ER73780 itemized_charitable
rename ER73781 itemized_medical
** Child care.
rename ER72748 childcare_expense
rename ER72749 childcare_expense_unit
rename ER73793 alimony_given
** Mortgage payments.
rename ER72050 mortgage1_original_or_refinanced
rename ER72051 mortgage1_principle_remaining
rename ER72053 mortgage1_payment
rename ER72058 mortgage1_interest_rate_wholenum
rename ER72059 mortgage1_interest_rate_fraction
rename ER72057 mortgage1_fixed_variable
rename ER72060 mortgage1_year_of_loan
rename ER72061 mortgage1_years_left
rename ER72069 mortgage2_binary
rename ER72070 mortgage2_type
*WHY ARE THEY NOT IN THE DATASET? WEIRD. THEY SHOULD BE
*rename ER66071 mortgage2_original_or_refinanced
*rename ER66072 mortgage2_principle_remaining
*rename ER66074 mortgage2_payment
*rename ER66079 mortgage2_interest_rate_wholenum
*rename ER66080 mortgage2_interest_rate_fraction
*rename ER66078 mortgage2_fixed_variable
*rename ER66081 mortgage2_year_of_loan
*rename ER66082 mortgage2_years_left
*rename ER66055 mortage1_include_proptaxes
*rename ER66056 mortgage1_include_insurance

** Food consumption.
rename ER72788 monthly_food_stamps 
gen food_stamps=12*monthly_food_stamps
//it is last month, not last year!
*rename ER36703 food_stamps_unit
rename ER72791 food_homestamps
rename ER72792 food_homestamps_unit
rename ER72795 food_deliveredstamps
rename ER72796 food_deliveredstamps_unit
rename ER72798 food_awaystamps
rename ER72799 food_awaystamps_unit
rename ER72801 food_home
rename ER72802 food_home_unit
rename ER72805 food_delivered
rename ER72806 food_delivered_unit
rename ER72808 food_away
rename ER72809 food_away_unit

** GENERATED FIELDS.
rename ER77291 unincorp_bus_inc_hh_gen
rename ER77296 unincorp_laborpt_inc_head_gen
rename ER77297 unincorp_assetpt_inc_head_gen
rename ER77294 farm_inc_head_gen
rename ER77299 wagesal_inc_head_gen
rename ER77301 bonus_inc_head_gen
rename ER77303 overtime_inc_head_gen
rename ER77305 tips_inc_head_gen
rename ER77307 commission_inc_head_gen
rename ER77309 trade_inc_head_gen
*rename ER40915 gardening_inc_head_gen
rename ER77311 addljob_inc_head_gen
rename ER77315 labor_inc_head_gen
rename ER77316 rent_inc_head_gen
rename ER77318 dividend_inc_head_gen
rename ER77320 interest_inc_head_gen
*rename ER71300 trustroyalty_inc_head_gen

rename ER77324 unincorp_laborpt_inc_wife_gen
rename ER77325 unincorp_assetpt_inc_wife_gen
rename ER77343 labor_inc_wife_gen 
rename ER77344 rent_inc_wife_gen
rename ER77346 dividend_inc_wife_gen
rename ER77348 interest_inc_wife_gen
rename ER77350 trustroyalty_inc_wife_gen

rename ER77352 taxable_inc_hh_gen

rename ER77353 tanf_inc_head_gen
rename ER77355 ssi_inc_head_gen
rename ER77357 otherwelfare_inc_head_gen
rename ER77359 vapension_inc_head_gen
rename ER77361 nonva_retire_inc_head_gen
rename ER77365 annuities_inc_head_gen
rename ER77369 unemployment_inc_head_gen
rename ER77371 workerscomp_inc_head_gen
rename ER77373 childsupport_inc_head_gen
rename ER77375 alimony_inc_head_gen
rename ER77377 helprelatives_inc_head_gen
rename ER77379 helpothers_inc_head_gen
rename ER77381 misc_xfers_inc_head_gen

rename ER77383 tanf_inc_wife_gen
rename ER77385 ssi_inc_wife_gen
rename ER77387 otherwelfare_inc_wife_gen

rename ER77393 spouse_annuities
rename ER77391 spouse_retirement_pensions

gen retire_annuities_inc_wife_gen=spouse_annuities+spouse_retirement_pensions

rename ER77399 unemployment_inc_wife_gen
rename ER77401 workerscomp_inc_wife_gen
rename ER77403 childsupport_inc_wife_gen
rename ER77407 helprelatives_inc_wife_gen
rename ER77409 helpothers_inc_wife_gen
rename ER77411 misc_xfers_inc_wife_gen


rename ER77442 socsec_inc_head_gen
rename ER77444 socsec_inc_wife_gen

rename ER72494 hr_wage_spouse
rename ER72217 hr_wage_hd
rename ER73069 tot_wage_hd
rename ER73424 tot_wage_spouse
rename ER77255 tot_hs_worked_head
rename ER77276 tot_hs_worked_spouse

rename ER76960 religion_hd
rename ER76815 religion_spouse
rename ER77592 rural

rename ER73310 whether_unemployed_head
rename ER73664 whether_unemployed_spouse

drop ER*

save fam2019er-small.dta, replace




